/**
 * 自动滚动指令
 */

export const autoScrollDirective = {
  updated(el, binding) {
    if (binding.arg === 'bottom' && el.lastElementChild) {
      setTimeout(() => {
        el.lastElementChild.scrollIntoView({ behavior: 'smooth' })
      }, 50)
    }
  }
}

export default autoScrollDirective
